package org.yaukie.core;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *  @Author: yuenbin
 *  @Date :2020/5/16
 * @Time :9:39
 * @Motto: It is better to be clear than to be clever !
 * @Destrib:  顶级job
**/
public abstract class BaseJob implements Job{

	private static final Logger log = LoggerFactory.getLogger(BaseJob.class);

	private JobExecutionContext context ;

	 @Override
	public final void execute(JobExecutionContext context) throws JobExecutionException {
		 try{
		 	this.context = context ;
			 execute();
		 }catch(Exception e ){
			 log.error("job execute error  {}",e);
		 }
		
	}

	public abstract  void execute();

	public JobExecutionContext getContext() {
		return context;
	}
}
